﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master_form.master" AutoEventWireup="true" CodeFile="ds_ts_do.aspx.cs" Inherits="App_Form_tuyen_sinh_ds_ts_do" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">

        Ext.require([
        'Ext.selection.CellModel',
        'Ext.grid.*',
        'Ext.data.*',
        'Ext.util.*',
        'Ext.state.*',
        'Ext.form.*',
        'Ext.grid.Panel'
        ]);

        Ext.onReady(function () {

            Ext.QuickTips.init();

            var bd = Ext.getBody();

            var gridForm = Ext.create('Ext.form.Panel', {
                id: 'company-form',
                frame: true,
                bodyPadding: 5,
                layout: {
                    type: 'column',
                    columns: 2
                },
                fieldDefaults: {
                    labelAlign: 'left',
                    msgTarget: 'side'
                },

                items: [
                    {
                        margin: '0 0 0 2',
                        padding: '10 5 5 5',
                        xtype: 'fieldset',
                        title: '',
                        defaults: {
                            width: 350,
                            labelWidth: 90
                        },
                        defaultType: 'textfield',
                        items: [
                            {
                                fieldLabel: 'Năm tuyển sinh',
                                xtype: 'combo', value: 'I', emptyText: 'Chọn năm học',
                                triggerAction: 'all', forceSelection: true, editable: false,
                                id: 'nam_hoc', name: 'nam_hoc', displayField: 'ten', valueField: 'id',
                                queryMode: 'local'
                            },
                            {
                                fieldLabel: 'Khối thi',
                                xtype: 'combo', emptyText: 'Chọn khối thi', triggerAction: 'all',
                                forceSelection: true, editable: false, id: 'khoithi',
                                name: 'khoithi', displayField: 'Ten', valueField: 'Ma_khoi'
                            },
                             {
                                 fieldLabel: 'Xét tuyển theo', hidden: true,
                                 xtype: 'combo', emptyText: 'Chọn xét tuyển theo', triggerAction: 'all', value: 'HS',
                                 forceSelection: true, editable: false, id: 'xet_tuyen', name: 'xet_tuyen',
                                 store: [
                                    ['HS', 'Chỉ tiêu học sinh'],
                                    ['D', 'Điểm chuẩn công bố']
                                 ],
                                 queryMode: 'local'
                             },
                        {
                            xtype: 'fieldcontainer',
                            combineErrors: true,
                            layout: {
                                type: 'hbox',
                                defaultMargins: { top: 0, right: 5, bottom: 0, left: 0 }
                            },
                            items: [
                             
                                {
                                    name: 'In',
                                    xtype: 'button',
                                    margin: '0 0 0 5',
                                    width: 120,
                                    icon: '../../shared/icons/fam/print.png',
                                    text: 'Giấy báo điểm',
                                    handler: function () {
                                        var b_nam = Ext.getCmp("nam_hoc").getValue(), b_khoi = Ext.getCmp("khoithi").getValue();
                                        wsinh_vien.Fs_TUYEN_SINH_DIEM_PBD(b_nam, b_khoi, ds_bao_diem_P_KQ, P_LOI_CSDL, P_LOI_TGIAN);
                                    }
                                }
                            ]
                        }
                        ]
                    }
                ],
                renderTo: bd
            });
            wsinh_vien.Fs_DIEM_TUYEN_SINH_TTCHUNG(P_LOAD_TTCHUNG, P_LOI_CSDL, P_LOI_TGIAN);
        });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        function P_LOAD_TTCHUNG(b_kq) {
            if (Fb_LOI_KTRA(b_kq)) {
                form_P_LOI(b_kq);
                return;
            }

            var a_kq = b_kq.split('@');
            var b_chuoi1 = CH_JSON(a_kq[0]),
                b_chuoi2 = CH_JSON(a_kq[1]);

            var a_data1 = Ext.create('Ext.data.Store', {
                fields: ['id', 'ten'],
                data: b_chuoi1
            });

            var a_data2 = Ext.create('Ext.data.Store', {
                fields: ['Ma_khoi', 'Ten'],
                data: b_chuoi2
            });

            var cd = Ext.getCmp('nam_hoc');
            cd.bindStore(a_data1);

            var b_hk = Ext.getCmp("khoithi");
            b_hk.bindStore(a_data2);
        }
        function ds_bao_diem_P_KQ(b_kq) {
            if (Fb_LOI_KTRA(b_kq)) {
                form_P_LOI(b_kq);
                return;
            }

            var tenf = '<%= this.ResolveUrl("~/Outputs/")%>';
             var a_kq = b_kq.split('/');
             tenf = tenf + a_kq[2];
             window.location.assign(tenf);
         }
    </script>
</asp:Content>

